//
//  CommonConfig.swift
//  SinaWeibo_18
//
//  Created by mac on 15/10/11.
//  Copyright © 2015年 cz. All rights reserved.
//

import Foundation
import UIKit

let ScreenWidth = UIScreen.mainScreen().bounds.size.width
let ScreenHeight = UIScreen.mainScreen().bounds.size.height

//定义log的打印
func printLog(message: AnyObject, error: Bool = false, fileName: String = __FILE__, line: Int = __LINE__, methodName: String = __FUNCTION__){
    
    if error {
        print("\((fileName as NSString).lastPathComponent)[\(line)]\(methodName):\(message)" )
    }else{
        #if DEBUG
        print("\((fileName as NSString).lastPathComponent)[\(line)]\(methodName):\(message)" )
            
        #endif
    }

}
//定义颜色
func RGB(r r: CGFloat, g: CGFloat, b: CGFloat) -> UIColor{
    return UIColor(red: r/255.0, green: g/255.0, blue: b/255.0, alpha: 1.0)
}
//定义随机颜色
func randomColor() -> UIColor{
    return RGB(r:CGFloat(random()%255), g: CGFloat(random()%255), b: CGFloat(random()%255))
}
